package top.zuli.package01.class04;

import java.util.Scanner;

public class ArrayTest1 {
    public static void main(String[] args) {
        String[] names = new String[5];
        Scanner input = new Scanner(System.in);
        for (int i = 0; i < names.length; i++) {
            System.out.print("请输入第"+(i+1)+"个同学的名字：");
            String name = input.nextLine();
            names[i] = name;
        }
        System.out.println("学生信息如下----------------");
        for (int i = 0; i < names.length; i++) {
            System.out.println(names[i]);
        }
        /*System.out.println("学生信息如下----------------");
        for (String name : names) {
            System.out.println(name);
        }*/
    }
}
